@echo off
D:
cd D:\
cd "D:\_USB\Eq-Calc_Java\LibChemDiagr"
if exist "!Update_Clean.cmd" goto cont
echo Error - FILE NOT FOUND: "!Update_Clean.cmd"
goto end
:cont

echo ----------------------------------------------------------
echo Copy  "dist\LibChemDiagr.jar"  (update)
echo ----------------------------------------------------------
if exist .\dist\LibChemDiagr.jar goto cont_dist
echo.
echo.
echo *********************************************************************
echo !!    Warning - FILE NOT FOUND: "dist\LibChemDiagr.jar"    !?
echo *********************************************************************
echo.
echo.
echo (going to remove unnecessary files)
pause
goto cont_no_dist
:cont_dist
@echo xcopy .\dist\LibChemDiagr.jar ..\dist\lib\*.* /R /Y /D
xcopy .\dist\LibChemDiagr.jar ..\dist\lib\*.* /R /Y /D
echo.
echo - - - -
echo going to remove unnecessary files, etc
:cont_no_dist
if exist ".\build" rmdir /q /s .\build >nul
if exist ".\store" rmdir /q /s .\store >nul
if exist ".\dist" rmdir /q /s .\dist >nul
echo - - - -
echo.
echo All done.
:end
pause